-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Tests: Ensure test filename and class name align #10643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests: Ensure test filename and class name align #10643
Conversation
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
| * @group https-migration | ||
| */ | ||
| class Tests_HTTPS_Migration extends WP_UnitTestCase { | ||
| class Tests_HttpsMigration extends WP_UnitTestCase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| class Tests_HttpsMigration extends WP_UnitTestCase { | |
| class Tests_HTTPSMigration extends WP_UnitTestCase { |
| * @group https-detection | ||
| */ | ||
| class Tests_HTTPS_Detection extends WP_UnitTestCase { | ||
| class Tests_HttpsDetection extends WP_UnitTestCase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| class Tests_HttpsDetection extends WP_UnitTestCase { | |
| class Tests_HTTPSDetection extends WP_UnitTestCase { |
| * @coversDefaultClass WP_User_Query | ||
| */ | ||
| class Tests_User_Query_Cache extends WP_UnitTestCase { | ||
| class Tests_User_QueryCache extends WP_UnitTestCase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| class Tests_User_QueryCache extends WP_UnitTestCase { | |
| class Tests_User_QueryCache extends WP_UnitTestCase { |
| */ | ||
|
|
||
| class Tests_WpIsValidUtf8TestCase extends WP_UnitTestCase { | ||
| class Tests_Unicode_WpIsValidUtf8 extends WP_UnitTestCase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| class Tests_Unicode_WpIsValidUtf8 extends WP_UnitTestCase { | |
| class Tests_Unicode_WpIsValidUTF8 extends WP_UnitTestCase { |
| * @group formatting | ||
| */ | ||
| class Tests_DeprecatedUtf8EncodeDecodeTest extends WP_UnitTestCase { | ||
| class Tests_Formatting_DeprecatedUtfEncodeDecode extends WP_UnitTestCase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| class Tests_Formatting_DeprecatedUtfEncodeDecode extends WP_UnitTestCase { | |
| class Tests_Formatting_DeprecatedUTFEncodeDecode extends WP_UnitTestCase { |
f6cb549 to
ae01369
Compare
|
Abandoning this based on https://core.trac.wordpress.org/ticket/62004. |
Fix class names or filename to match PHPUnit expectations.
PHPUnit can be run with a filename argument:
However, certain test files and test suite class names do not align with PHPUnit expectations and it may fail to run any tests, for example:
Trac ticket: https://core.trac.wordpress.org/ticket/64225
I used this script (and some variations) to detect the files with this problem. The idea being that no tests actually match the filter (so the suite should never fail) but the suite does fail if the test class cannot be found:
bad test files on
trunk(alphabetized)Note that most of the
base.phpclasses are abstract classes meant to be extended, not actually run as a test suite.